<template>
  <div id="app">
    <div id="nav">
      <root-nav />
    </div>
    <div class="content-x">
      <div class="current-router-x">当前页面位置：<span>src/views/{{currentRouter}}/index.vue</span></div>
      <router-view/>
    </div>
  </div>
</template>

<script>
import RootNav from '@/components/RootNav'
export default {
  components: {
    RootNav
  },
  computed: {
    currentRouter() {
      return this.$route.name
    }
  }
}
</script>

<style lang="scss">
html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
#app {
  display: flex;
}
#nav {
  min-width: 180px;
  height: 100%;
  overflow-y: hidden;
}
.content-x {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.current-router-x {
  margin: 4px;
  span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 1px 4px;
    border-radius: 4px;
    background-image: linear-gradient(120deg, #ed6ea0 0%, #ec8c69 100%);
    color: #fff;
  }
}
.page-x { /* 每个页面组件的根标签都设置了该类 */
  width: 100%;
  flex: 1;
}
</style>
